package com.qk.management.mapper;

import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ZLJ
 * @date 2025/10/9 10:55
 * @Description
 */
@Mapper
@SuppressWarnings("all")
public interface CourseMapper {

    @Delete("delete from course where id= #{id}")
    void deleteById(Integer id);

    @Select("select * from course where subject= #{subject}")
    void getBySubject(Integer subject);

    @Select("select * from course")
    List<Course> selectAll();

    void update(Course course);

    void insert(Course course);

    @Select("select * from course where id=#{id}")
    Course getById(Integer id);

    Integer count(String name, Integer subject, String target);

    List<Course> selectByPage(String name, Integer subject, String target, Integer offset, Integer pageSize);
}
